package org.ehe.finance.receipt.constants;

/**
 * 收款单常量
 * @author :zhangnn
 * @className :ReceiptConstants
 * @description: TODO
 * @date 2025-09-02 15:33:54
 */
public class ReceiptConstants {

    /**
     * 收款单号前缀
     */
    public static final String RECEIPT_NO_PREFIX = "SK";

    /**
     * 收款单状态
     */
    public static class Status {
        /** 未审核 */
        public static final Integer DRAFT = 1;
        /** 已审核 */
        public static final Integer AUDITED = 2;
    }

    /**
     * 收款类型
     */
    public static class ReceiptType {
        /** 销售收款 */
        public static final Integer SALES_RECEIPT = 1;
        /** 预收款 */
        public static final Integer ADVANCE_RECEIPT = 2;
        /** 其他收款 */
        public static final Integer OTHER_RECEIPT = 3;
    }

    /**
     * 收款方式
     */
    public static class PaymentMethod {
        /** 现金 */
        public static final Integer CASH = 1;
        /** 银行转账 */
        public static final Integer BANK_TRANSFER = 2;
        /** 票据 */
        public static final Integer BILL = 3;
        /** 其他 */
        public static final Integer OTHER = 4;
    }

    /**
     * 删除标志
     */
    public static class DelFlag {
        /** 正常 */
        public static final String NORMAL = "0";
        /** 删除 */
        public static final String DELETED = "1";
    }

    /**
     * 错误消息
     */
    public static class ErrorMessages {
        public static final String RECEIPT_NOT_FOUND = "收款单不存在";
        public static final String RECEIPT_NO_EXISTS = "收款单号已存在";
        public static final String RECEIPT_AUDITED = "收款单已审核，不能修改";
        public static final String RECEIPT_NOT_AUDITED = "收款单未审核";
        public static final String AMOUNT_MISMATCH = "收款总金额与明细金额合计不一致";
        public static final String DETAIL_REQUIRED = "收款明细不能为空";
        public static final String INVALID_AMOUNT = "金额必须大于0";
        public static final String INVALID_DATE = "收款日期不能超过当前日期";
    }

    /**
     * 成功消息
     */
    public static class SuccessMessages {
        public static final String CREATE_SUCCESS = "创建收款单成功";
        public static final String UPDATE_SUCCESS = "更新收款单成功";
        public static final String DELETE_SUCCESS = "删除收款单成功";
        public static final String AUDIT_SUCCESS = "审核收款单成功";
        public static final String UNAUDIT_SUCCESS = "反审核收款单成功";
        public static final String GENERATE_NO_SUCCESS = "生成收款单号成功";
    }

    /**
     * 默认值
     */
    public static class Defaults {
        /** 默认汇率 */
        public static final String DEFAULT_EXCHANGE_RATE = "1.0000";
        /** 默认查询天数 */
        public static final Integer DEFAULT_DUE_DAYS = 7;
        /** 默认分页大小 */
        public static final Integer DEFAULT_PAGE_SIZE = 20;
    }

    /**
     * 限制值
     */
    public static class Limits {
        /** 收款单号最大长度 */
        public static final Integer RECEIPT_NO_MAX_LENGTH = 50;
        /** 备注最大长度 */
        public static final Integer REMARK_MAX_LENGTH = 500;
        /** 明细最大数量 */
        public static final Integer MAX_DETAIL_COUNT = 100;
        /** 批量操作最大数量 */
        public static final Integer MAX_BATCH_SIZE = 500;
    }

    /**
     * 缓存键
     */
    public static class CacheKeys {
        /** 收款单号序列缓存 */
        public static final String RECEIPT_NO_SEQUENCE = "receipt:no:sequence:";
        /** 客户收款统计缓存 */
        public static final String CUSTOMER_STATISTICS = "receipt:statistics:customer";
        /** 月度统计缓存 */
        public static final String MONTHLY_STATISTICS = "receipt:statistics:monthly";
    }

    /**
     * 正则表达式
     */
    public static class Patterns {
        /** 收款单号格式 */
        public static final String RECEIPT_NO_PATTERN = "^[A-Z0-9-]+$";
        /** 金额格式 */
        public static final String AMOUNT_PATTERN = "^\\d{1,12}(\\.\\d{1,2})?$";
        /** 手机号格式 */
        public static final String PHONE_PATTERN = "^1[3-9]\\d{9}$";
        /** 邮箱格式 */
        public static final String EMAIL_PATTERN = "^[\\w.-]+@[\\w.-]+\\.[a-zA-Z]{2,}$";
    }
}
